home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 October: Windmill on DISC / ADC Developer CD (1993-10) (''Windmill On DISC'')_iso / Dev.CD Oct 93.iso / Utilities / Installer v3.4.3 / Examples - Installer 3.4 / InstallINIT.r < prev    next >
Encoding:
Text File  |  1993-06-15  |  5.6 KB  |  158 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: demonstrates installing an INIT into the appropriate folder
  6.  *
  7.  *    File:        InstallINIT.r -    Rez Source
  8.  *
  9.  *  Modifications:
  10.  *        5/19/93: RRK Changed Target file spec typeCrMustMatch flag setting to
  11.  *                        typeCrNeedNotMatch and included comment that this will
  12.  *                        allow the replacement of the target file if for some reason
  13.  *                        the file or creator are different.
  14.  *                     Used InstallerCommon.r defines.
  15.  *
  16.  *    by:            Jon Zap
  17.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  18.  *
  19.  *    Copyright © 1991 Apple Computer, Inc.
  20.  *    All rights reserved.
  21.  *
  22.  *------------------------------------------------------------------------------
  23.  * This sample installs "TheINIT" into the appropriate system
  24.  * folder.  It allows for custom installation/removal.  The script implements 
  25.  * so if we specify the extensions folder but it does not exist, the Installer will
  26.  * use the system folder instead. This greatly simplifies the script.
  27.  *----------------------------------------------------------------------------*/
  28.  
  29. #include "Types.r"                    /* for the ICON resource */
  30. #include "InstallerTypes.r"
  31. #include "InstallerCommon.r"        /* list of macros to simplify list */
  32.  
  33. /* You can build and complete the script with the following lines:
  34. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  35. # or set up folders with the same names and contents as the floppies
  36. # put these folders in the same folder as the script or at the root directory of same disk
  37.  
  38.     rez -o "InstallINIT" -t 'bbkr' -c 'bbkr' "InstallINIT.r"
  39.     setfile -a i "InstallINIT"        #mark Inited
  40.     scriptcheck -p "InstallINIT"
  41. */
  42.  
  43. /* Definitions for the rules */
  44. #define rlAddInit                1000
  45.  
  46. /* Defines for the file spec atoms.  These are specifications for source and destination files */
  47. #define fsSourceINIT            2000
  48. #define fsTargetINIT            2001
  49.  
  50. /* This is the name of the source disk */
  51. #define INITDisk "INIT Disk:"
  52.  
  53. /* where we want to install our file. */
  54. #define TargetPath    "special-extn:"
  55.  
  56. /* Definition for the package. */
  57. #define pkTheINIT            3000
  58.  
  59. /* Definition for the file atom */
  60. #define faINIT                4000
  61.  
  62. /* Definition for the package comment resource */
  63. #define cmtTheINIT            5000
  64. #define iconTheINIT            6000
  65.  
  66. /* May 19, 1993 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  67. /* this value to a LongInt seconds value needed by the Installer. */
  68. #define currentReleaseDate        5191993    
  69. #define currentVersion            102     /* Version 1.0.2 goes in the 'icmt' rsrc */
  70.  
  71.  
  72. /************************** Easy Install Rule resources **********************************/
  73. resource 'infr' (1) {
  74.     format0  {{
  75.         pickAll,    {rlAddInit},     /* Select the rule */
  76.     }};
  77. };
  78.  
  79. /* note the '.' in the first rule is missing in the 2nd rule so we can differentiate*/
  80. resource 'inrl' (rlAddInit) {
  81.     format0 {{
  82.         addUserDescription {"Click Install button to install\n"}, /* message to appear in Easy Install screen */
  83.         addUserDescription {"• The INIT.\n"},    /* message to appear in Easy Install screen */
  84.         addPackages {{pkTheINIT}}            /* we're installing the INIT */
  85.     }};
  86. };
  87.  
  88. /***************************** Package Resources ************************************************/
  89. resource 'inpk' (pkTheINIT) {
  90.     format0 {
  91.         ShowsOnCustom,                     /* Package appears in the Custom Install display */
  92.         Removable,                        /* Package can be removed */
  93.         forceRestart,                    /* so we actually activate the init */
  94.         cmtTheINIT,                     /* package's 'icmt' resource id */
  95.         0,                                /* Package size (filled in by ScriptCheck) */
  96.         "Install TheINIT", { /* package name for package that shows on custom */
  97.             'infa', faINIT;
  98.         }
  99.     }
  100. };
  101.  
  102. /***************************** Comments ************************************************/
  103. resource 'icmt' (cmtTheINIT) {
  104.     currentReleaseDate,
  105.     currentVersion,
  106.     iconTheINIT,
  107.     "This package contains TheINIT. "
  108. };
  109.  
  110. resource 'ICON' (iconTheINIT) {
  111.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  112.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  113.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  114.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  115.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  116.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  117.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  118.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  119. };
  120.  
  121.  
  122.  
  123. /********************************************* File Specs *******************************************/
  124. /* Source File Specs */
  125. resource 'infs' (fsSourceINIT) {
  126.     'INIT',                                /* File Type */
  127.     '????',                                /* Creator */
  128.     kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  129.     noSearchForFile,                    /* Do not search the source disk for the file */
  130.     TypeCrMustMatch,                    /* file type and creator on source disk must match */
  131.     INITDisk"TheINIT"                    /* Path to the file */
  132. };
  133.  
  134. /* Target File Specs */
  135. resource 'infs' (fsTargetINIT) {
  136.     'INIT',                                /* File Type */
  137.     '????',                                /* Creator */
  138.     kNoDateStampCheck,                    /* creation date must be zero for target file spec */
  139.     noSearchForFile,                    /* Do not search the target disk for the file */
  140.     typeCrNeedNotMatch,                    /* file to be replaced even if F&C don't match  */
  141.     TargetPath"TheINIT"                    /* destination Path */
  142. };
  143.  
  144.  
  145. /******************************************** File Atoms ************************************************/
  146. resource 'infa' (faINIT) {
  147.     format0 {
  148.         StdRemLeaveNewerCopy,            /* see InstallerCommon.r */
  149.         fsTargetINIT,                    /* TARGET file spec for this file */
  150.         fsSourceINIT,                     /* SOURCE file spec for this file */
  151.         0,                                /* atom size (filled in by ScriptCheck) */
  152.         ""                                /* Atom Description (Installer will use file name) */
  153.     };
  154. };
  155.  
  156.  
  157.  
  158.